@extends('user._layouts.default')

@section('css')
    {{HTML::style('user/css/base.css')}}
@stop

@section('user-main')
<div style="font-size: 25px;">{{{$title or ''}}}<a href="{{URL::to('user/projects')}}" class="am-btn am-fr am-btn-xs am-btn-primary">我的软件</a></div>
<hr/>

  @if(Session::has('message'))
      <div class="am-alert am-alert-{{Session::get('message')['type']}} am-margin am-text-center" data-am-alert>{{Session::get('message')['content']}}</div>
  @endif
  @if($errors->has())
      <div class="am-alert am-alert-danger am-margin am-text-center" data-am-alert>{{$errors->first()}}</div>
  @endif
  {{Form::open(array('url'=>'user/blog/doaddblog','method'=>'post','class'=>'am-form am-form-horizontal am-margin-top-lg'))}}

  <div class="am-form-group">
    {{Form::label('title','博客标题',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::text('title')}}
    </div>
  </div>
  <div class="am-form-group">
    {{Form::label('user_category_id','博客分类',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::select('user_category_id',$user_category)}}
    </div>
  </div>
  <div class="am-form-group">
    {{Form::label('abstracts','博客摘要',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::textarea('abstracts','',array('style'=>'height:100px;'))}}
    </div>
  </div>

  <div class="am-form-group">

    <div class="am-u-sm-12">
      {{Form::textarea('content','',array('id'=>'content','style'=>'height:500px;'))}}
    </div>
  </div>

  <div class="am-form-group">
    {{Form::label('tags','标签',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::text('tags')}}
    </div>
  </div>
 <div class="am-form-group">
    {{Form::label('system_category_id','系统分类',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::select('system_category_id',array('GPL'=>'GPL','Apache'=>'Apache','BSD'=>'BSD'),'GPL')}}
    </div>
  </div>
   <div class="am-form-group">
    {{Form::label('blog_type','文章类型',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::radio('blog_type','1')}}原创
      {{Form::radio('blog_type','2')}}转载
    </div>
  </div>
  <div class="am-form-group">
    {{Form::label('origin_url','转载地址',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::url('origin_url')}}
    </div>
  </div>

   <div class="am-form-group">
    {{Form::label('privacy','是否可见',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::checkbox('privacy',1)}}
    </div>
  </div>
   <div class="am-form-group">
    {{Form::label('deny_comment','允许评论',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::checkbox('deny_comment',1)}}
    </div>
  </div>
   <div class="am-form-group">
    {{Form::label('as_top','是否置顶',array('class'=>'am-u-sm-2 am-form-label'))}}
    <div class="am-u-sm-10">
      {{Form::checkbox('as_top',1)}}
    </div>
  </div>
  <div class="am-form-group">
    <div class="am-u-sm-10 am-u-sm-offset-2">
      {{Form::submit('发布软件',array('class'=>'am-btn am-btn-primary'))}}
    </div>
  </div>
{{Form::close()}}


@stop
<!--[if (gte IE 9)|!(IE)]><!-->
@section('js')
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="{{URL::asset('ueditor/ueditor.config.js')}}"></script>
<script type="text/javascript" src="{{URL::asset('ueditor/ueditor.all.js')}}"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript">
  //实例化编辑器
  var ue = UE.getEditor('content');
</script>
@stop
